package com.hqq.presentation_tier.flux.store;

import com.hqq.presentation_tier.flux.action.Action;
import com.hqq.presentation_tier.flux.action.ActionType;
import com.hqq.presentation_tier.flux.action.Content;
import com.hqq.presentation_tier.flux.action.ContentAction;

/**
 * ContentStore
 * Created by heqianqian on 2017/8/17.
 */
public class ContentStore extends Store {

    private Content content;

    @Override
    public void onAction(Action action) {
        if (action.getType().equals(ActionType.CONTENT_CHANGED)) {
            ContentAction contentAction = (ContentAction) action;
            this.content = contentAction.getContent();
            notifyChange();
        }
    }

    public Content getContent() {
        return content;
    }
}
